Add index to res