Added error handling for parse errors