new logic for url pattern matching