Fix State Switch

Signed-off-by: Daniel <daxx4182@gmail.com>