gaurd against empty head

cc @sh1mmer