fixed the empty file error issue