Implemented UI element state tracking