fixed the double message error, threading appears to be working properly, though some race conditions appear to exist