fixing bug for creating database