proper detect script