fix disconnect event (bug created in 4e71e75f31c16b96ec563c717320e46b4c681906)