Add begin try around file open