Fixed error in state machine set active