updated motion detection