Which method is throwing this exception? If it is in the `head` call, then all its following code could be removed, just to make it clear that the method stops there.