Merged in reference error in JS