added reset code