fix #1 bug when resetting program