implement reset function