handle_empty_data function

Gracefully handle empty data