fix loading of scripts