fixed docache function