fixed send and recv, now checking for sanity (only recv values from current iteration)