fixed an issue whereby changing of credentials in js app causes duplication of new messages received.