clean up
add snapshot checking