added sanityCheck