updated invoice caching logic to address display issues