fixed bugs with remove