splitting js files for pages to prevent errors and fixing map