fix a crash due to the init order