fixed order of js calls in index