fixed bugs in copy and remove methods