getting data from db instead of scf