add sanity checks