Added onclose callback for client connection.