Fixed bugs with adapter