fix adapter crash issue