fix UI flow