fixing db scope