added sanity_check