bugfix in upgrade.php