fix bug initial setup of database failed