fix region code is not set bug