Block attach code