fix bug in selective receive and test typedReceive