appcontext fix from previous commit