bad substitution fix