added better input errors