Fixing queue not being emptied when a peer connects