added variable replacement