a new function updateActionButton() to update the action button