fixed bug in initDatabsae