suggestions from Jorge
fixed the reset