fix bug that wouldnt update the local state when remote changed