Added error checking on parser