updates #341

solves "Nan.undefined" bug