fix bug with recv of size 0