changed wildcard escape logic