Improved error handling and made new parser