Fixing server to read continuously from stream