error handling added in parser