fixed bugs in checking state in temporary state list