use append instead of setreg & p
Merge branch 'master' into themis