Made necessary changes to get the flow working