Callback for loadCode()