writing to file works