relocated validateInput