solves #18, empty files were not being handled properly