Use the same buffer but with bzero to store data. Invalidate the while loop