remove trailing character