Changes states in state_mahine