fixes #3138 . Update statistics after operation is run and before response is send to client