added receiving functionality