There were five separate flights to service the Hubble telescope. It was designed from the beginning to be repaired and upgraded.
https://en.wikipedia.org/wiki/STS-125