check object before access it