Changed time check location
pthread fix