changed unsigned to size_t since std::string::npos is size_t, and also is valued at -1, so unsigned file_index will always be true in comparison (file_index != std::string::npos)