fix compatibility with newer versions of jquery