fixing "missing first row" bug