implemented check of demographic filters prior to matching templates