added support for disconnect event