break loops if file size has reached. to avoid useless rows