Made some more changes to the sending logic.