Input validation check