added rwref support