fix the deleted endpoint problem