-fixed the delete function in index