added logging in app.new_context