             fatalError("Load config failed")
         }
 
-        guard let mysql = MySQLPerfect(host: dbconfig.host, user: dbconfig.user, passwd: dbconfig.password, dbname: dbconfig.dbname) else {
+        guard let mysql = MySQLPerfect(host: databaseConfig.host, user: databaseConfig.user, passwd: databaseConfig.password, dbname: databaseConfig.dbname) else {
             fatalError("Database init failed")
         }
-        let dbStorage = DatabaseStorage(database: mysql, prefix: dbconfig.tablePrefix)
+        let dbStorage = DatabaseStorage(database: mysql, prefix: databaseConfig.tablePrefix)
         let data = DataManager(dbStorage: dbStorage, memoryStorage: MemoryStorage())
         guard let utilities = UtilitiesPerfect() else {
             fatalError("Utilities init failed")

        self.routes = Routes()

        do {
            let config = try String(contentsOfFile: "./db.conf.json", encoding: String.Encoding.utf8)
            if let jsonData = config.data(using: String.Encoding.utf8) {
                if let json = try JSONSerialization.jsonObject(with: jsonData) as? [String: Any],
                    let host = json["host"] as? String,
                    let user = json["user"] as? String,
                    let password = json["password"] as? String,
                    let dbname = json["dbname"] as? String,
                    let tablePrefix = json["tablePrefix"] as? String {
                    dbconfig = DBConfig(host: host, user: user, password: password, dbname: dbname, tablePrefix: tablePrefix)
                } else {
                    fatalError("Load config failed")
                }

                            }

                            // Validate file size
                            guard upload.fileSize > 0 && upload.fileSize < self.siteConfig.uploadSizeLimit else {
                                return self.controller.error(session: session, message: "File size")
                            }

