fix scope
Move PersistingTaskStateListener to new file