Adapting to jQuery 2