Removed check for connection closing as it consumes too much memory, it could be added back in future as optional feature