fix class scope issue