adding null check instead of general truthy conditional