Changed cache database to an array