State validations and syntax error fix