PATCH: wrote a new unit test and fixed a bug with transitioning to unknown state