it is working now. It checks if there is any error when server is disconnected