Fixing db connection