fix for the functor of transform
fix to deal with empty files