Use `detach` instead of `delete`.

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