bugfix: db exceptions will release connections properly