added exception handler for parsing bad messages