added client save function
triggers on connect and disconnect of clients