JS error fixed