fix cache mechanism with promises