Add checking for empty files