fix another nil check issue