Updated widget and js to fix some bugs with unique ids