added domain auto detection