fix when there is no head field in database