Improved msg recv loop in parent.