fix error with empty file