fix loading a root main.js according to Tony's suggestions