fix wrong value being stored