simplify "remove last char" statement