substitution javascript null fix