Fixed JS error product is not defined