fixing bug in adapter