added more functions in cache_database