Fix db reference