Clearing prefixList after adding to queue