save/load attributes properly