Why does this happen in the controller and not as a callback in the model?