fixed a bug to the delete function