small check if an index file
add error check for file format