fix the previous fix for head_and_tail