renamed session to client (thanks Timpo)