improve the wildcard detection