updated for new jquery versions