fix isLocal logic (f*ck yeah unit tests!)