added try/catch to protect if invalid events were passed into the engine