move scope of queuing functions