fix: add sanity checks