Fix: Fixed possible database related exception "... already closed"