fix work for empty files