added check for not caching errors