Fixed issue with disconnect not being called