add login func at index