Fix bug: Write map in .js file