JS errors fixed