add life cycle method
Merge branch 'master' of github.com:xu33/snapshot