avoid Dir.exist? that is not available in Ruby1.8