fixed the additional line removal

according to:
http://stackoverflow.com/questions/5378163/can-i-use-preg-replace-to-strip-the-trailing-n-in-multiline-mode