Adding error handling on disconnection, router with invalid client