fix bugs of delete, test delete