Fix delete race condition