Changed to File.basename instead of gsub