Fix listening for disconnect events