checked input length before doing anything