[PR] hotfix - ensure that ns is not undefined at the start