implement proper fnmatch