Added second stage to control the UI