Fixed loop in data adapter