Added syntax error checks