adapted to used jquery version