S3d uses the script tab under process. If you have two process then you need two end codes.