Revert "some states logic"

This reverts commit 34f53be86a9b9d7757ce37672f66d84c6af55d19.
Revert "Revert "some states logic""

This reverts commit 8675facfe6b38d4b3e56f1dea69966514090a82c.
Revert "some states logic"

This reverts commit 34f53be86a9b9d7757ce37672f66d84c6af55d19.