fix for extra trailing new lines on attachments