fixed an issue where empty class wasn't being removed