fixed bug with adnthreads