fix bugs of remove()