call trim() method on strings for validation

Signed-off-by: Acconut <maerious@gmail.com>