Adding block head and dirname check