mthread rewrite loading scripts