changed recv() function to work with test page