r+ instead of w+, seek to end before writing