error checking input lengths