db is not defined