Some memory leak prevention, also I realized that I was being dumb with an earlier change to states.