use file path instead of file index