adding object check to avoid notice error on wp-login