added a queued threading function - generic for now