Use `detach` instead of `delete`.

Using `delete` cause an error. Use `detach` instead of `delete`.