updated recursive Cache#update to not create infinite loop when objects refer to each other