fix bug in adapter