Added the begin file check