get rid of potential spaces at the end of the name