made compatible with lower versions of jquery