fixed line wrap-around

fixed issue #558