attempt to make a recursive model save function