removed database.restore_cache to see if it fixes staledataerror