Added check for value object before setting the value