added the max-thread flag