remove ending spaces