Updated database retriever code

Updated database retriever code