fix db connection close