Change $.ui.ready to use $(document).on  - jQuery wasn't triggering $.ui.ready