try except for files