ported to new jquery version