trying to handle server disconnection