renamed index to debug