Fix memory leak in jQuery