DEBUG: fixing to handle the flow with modal