Changed code to fit with new client code