Fixed return type of thread func