ugly solve wildcard matching