remove last ! and . char