You are copying by reference here. This must be value.clone();