scoping error in class tw