make determining if the file should be added to the queue a separate method.