client_disconnect and client connect event aswell as better end handling