finishing string functin