Can not access static within anonymous function