trim extra whitespace on inputs