fix adapter bugs