adding sanity checks