garding against empty files