fix compatibility with jQuery