added autodelete of trailing whitespace