Bug fix for queue maangement