Complete update method and add flash messages.