fix adapter never null and clear state for it