fixed input validation duplication bug