buttons and detection finished