fix issue with stripping trailing whitespace from input