Add jquery check inside the scrip