handling some input errors