added update component function

this way, the components themselves can be immutable.