How firm capabilities affect who benefits from foreign technology