proper reset of state upon enter

Fix #1887