This should probably only be executed if `allowStringValue === true`. So wrap it all in an `if` block.