added try/catch clause to client constructor