fix writing/reading of mathpass file