trim required values before checking

this closes #4