Added error listener to catch unhandled errs