adding self origin detection