Replacing delete by detach
Merge pull request #184 from AoSiX/patch-3

Replacing delete by detach