fix nil check missing