completed db read function