Added on_pause for persistence