fixing endoffile