Added code to client to handle server crashes