added sanity check