Properly reset state