modify resources.js to be loaded when required