first implementation of setValue and receiveMessage