Added queue thread codes