dynamic initial mainfunc or mainfunc_new