fixed up client code