modified sth about socket connection