Update applyMap.js

adding logging