change the compilation into runtime, improve read variable from global