added replaceVar