edit functiion in controller connected to model update function