switch events to taking a state as input