bugfix in database_tools.py