better place for jquery check