~ fixed writing/reading bug