dealing with NULL values more gracefully