handle empty db and maps