Added edit and update in controller