Attempting to fix JS errors