bug fixes on script bundling