onRemove method fix, (issue #1)