db connection close bug fixed