Fixed message receive function