added check for non-replaced variables