fix detect script