Fixing reset bug