fixed queue bug, added test
Merge branch 'queueHotfix'