detection phase