fix empty file bug