Try to be more defensive in programming