bug with global average