Add reference to r

Without, data is not stored correctly