Fixes db connection