revert removing of setExternalContext