fix for rebuild cache function