added throw statement in parser