fix a critical bug of file attribute. Thanks @itsneo