fixes amount of times recv() gets called