pass client by reference