add cut-down version to show problem more clearly