remove spacebar at the end