added return if no content block in layout
corrected wrap function