remove spaces at the end