Add filter option to merge script