more defensive programming