added receive functionality