Ensure trigger is an object before passing it to hide()