Closed DB connection incorrecly