fix global detect