fixed logic for showing clearing warnings