fix the problem in validate length