Updated jquery function to avoid conflict