Fixes typo/error with for loop.

Was returning key instead of the name of the database which is the second returned value.