little fix on index
added debug info into main program