fixed the double message bug