add compatibily with jquery 1.9 & 1.10