handle empty keys case