fix the db connection leak bug