remove tail spaces