appcontext is deprecated, use context instead; close #497