Hybrid control for connectivity preserving flocking