handling input errors