escaping strings for javascript, maps bug