update the detect code