fix issues with mainJS