This is probably a long shot, but where is the end to your while loop?

Are you adding the NEW_LINE every time?