add index and javascript