creating snapshot, saving to db