fix JS errors