rework reset function