added resetting logic