use ctx instead of this
run_in_context needs to set scope.ctx
remove apply_to, ctx as this
fix server function exports