receive data logic