add file check guard