basename is used to make fnmatch work