processQueue function is updated