event leaving now works