throw better exception if object is somehow null