add ValueError; make error messages more clear