Fixed JavaScript reference error