add unit test to ensure state