Fixed another bug in input validation