working on saving refs