main: add sanity checks