bugfix: db closed when it shouldn't be in frontend