adding ref counting class