before update mjmain