fix jQuery undefined check