Cut file  logic changed