updated to take jquery object