handling input errors now works