modify socket and comment function