chmod in thread