fixed wrong substitution