How to rewrite a line in a file

after issuing
awk ' BEGIN { FS=","} { if (NR == 2) { $2 = 777 ;$1 = 888 } print } ' filename
command, I found that the line that I edited seperator become a blank. How can I set it back to comma?
For example,
123,456,789 becomes 888 777 789
[what I want is 888,777,789]

one more question, may I know whether filename > filename at the end of awk command is valid or not? I tried to do it but in the end I got a blank file for the original file.

awk ' BEGIN { FS=","; OFS=","} { if (NR == 2) { $2 = 777 ;$1 = 888 } print } ' filename > temp
mv temp filename