Changed the logic in 'file-set' function.