Fixed Database upgrade