The solution is to capture at .
If White tries to escape with , then Black makes two eyes and lives.
White cannot play inside anymore and Black is alive.
Even with an additional stone helping White to connect, Black lives.
If here, sets up a ko which Black must win in order to live. Since Black can live unconditionally, this is not the best result.