updated functions to corrrect jquery