fixing db lock