moved def index to the top of the users_cntroller