Fixed JavaScript error