Fix #27 by writing to appdata