Added path filter function