fix javascript on clicks