Added timeout and retry for the client