fix logic error with data object initialization