a little errorchecking