Added functionality for handling sent and unsent states on UI elements.