Replace deprecated localContext with d2wContext