Updated file finished logic