handle db nil in dashboard