working version - queue is not working