db is a member variable