Fix issue on pre-action changing file length