throw errors if something went wrong in parsing