add sanity check