Validate before taking the input and do anything with it