added null vs undefined and substr and substring