bugfix upgrade_db