added syntax error check