trim required values before checking