Added clearCache function