changed exclude pattern logic