Get rid of flush method (maybe causing the socket error)