DB test function returns desired data when called