add reference counting memory management logic