Fixed State memory leak

States now get deleted for sure!