add queue
fix threading