fixed empty file bug