fixing db calls