Fixing jquery bug