added ValueError to except per graf codereview