handle null values gracefully