aren't you appending a null record here in the first iteration?