update add and edit in ViewController