bug fix when checking target namespace.