updated client to make it more fault tolerant