functions for handling work queues