convert pendingQueue to List
fix race in cleanup(), iterating and clear