fix generating wrong id used in caching