Added some proper error handling for unknown events