fixed ref problem. checkpoint
before inserting lots of line breaks..
working version