fix bug for empty file