bug fix with reset code