receive function optimized.