modified code, not get rid of all invalid syntaxes
get rid of all invalid syntaxes