upstream changes for sandboxing