added a couple of verifications to the parser