more defensive checks