fixing bugs on codepage and updating index file