detection nearly working