Substring Is Not A Function In Javascript