Fixed the delete problems