added pg connection close