Add validation to parser