add index for users and change method