Updated to work with lastest jquery libs