add index version 2, and edited javascript