proper nil check