added edit and update methos to controller