Completed the flow for same and cross domain