moved validation to input method