fixed ref/unref for readers