Fix receive logic