fixes bug in NS instantiation