Move pthread to the end