updated the code with the flow and profile