handle edge cases in transformations