remove trailing chars