safer check for jquery object