possoibile bug fix for the no line to end here problem