added has_blocks function