Fixed looping issue when recv