stripping whitespace before validation