fixed a bug that causes crash on upgrading database