fixed error: db is not defined