use File.basename to get filename instead of regex