Attempting to fix JS error