define programWithCtx and use it