Add function o get file index