Updating State Machine