fixed client code