added additional logic for frontend caching