Fix postgres disconnect method