Logout and onBeforeDrag fixed