fixed timing
added state reset