modified clearing function to gz_ and non gz_ files