with fix to stop parser when error occurs