Bug fixed "Undefined variable: db"