adding parsing error handling