change text of publish button depending on state