update script for passing jquery selector