Fixed problem with deletion detection: stable version