Change to new detect method