added stop on error to knit settings
refined permutation test part