Network formation and its Impact on Systemic Risk