add null check to close #81