Add lastAction label and associated logic