sample detection fix