fix db connection issue - release upon error