corrects a substitution bug