move get_instance to init_by_lua
check phase when debug loging