Fixed bug that first row of output was deleted