use context instead of window