Adds error hangling to client 4