rewrote state deletion