fix haveInDatabase function

There is error in binding cycle. You can't use keys because keys are string.