fixed bugs on queues