use updated function in index view