added sanity check functions