Init Is Not A Function Javascript