fixed issues with jquery events order