add log for states
add restore logic for snapshot recovery