fix filtering for the proper conservation of meta data and add func to delete unused metas