setting object values correctly