fixed minor bug with DETECT button