was not properly deleteing state