fix the loop for lazily reading from db