# XO0803: task started without a scope handle

Xo has structured concurrency only: tasks are started with `s.spawn(f)` or `s.spawn_background(f)` on a scope handle inside `scope s { ... }`, or on a task group, so every task belongs to a scope that waits for it. There is no free `spawn` or `go` statement, and `spawn` on a value that is not a scope handle or group is an error. See core 7.1.

## Example

```xo
fn work() {}

fn f() {
  spawn(fn() { work() })
}
```

## Fix

```xo
fn work() {}

fn f() {
  scope s {
    s.spawn(fn() { work() })
  }
}
```

Run `xo explain XO0803` for this text in a terminal, or see
[section 10.6 of the specification](../../spec/core/#106-diagnostic-codes).

