checking against typeof === 'object' instead of instanceof jQuery.Event