Delete Function in Model for update and deletion