fix for trailing whitespace in user input