detect code