Add delete function and Check condition between create mode and update mode.