Fixes error with for loop.

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