Fixed the error in the database fetching

Signed-off-by: Rachel Logie <rachel.logie1@gmail.com>