added the script logic sith variable replacement