fix bug that cannot import & export files
format switch statements
change socket error message