changed c++ version and added debug limit on thread time