added security check for folding
moved require folding statement to folding-snps