bugfix set last detection only to 0 if the wal was detected