Fixing postgres connection