if the failed message is not present in the queue returns undefined and the rest of the list