Fix registerMainClientScript()