fix detect flag