add some sanity checks