Modify function of delete-endpoint