Rolled back to previous style of using a backroundthreadfuction to mainthreadfunction