Revised the flow