correctly retrieve original ids from cache