plugins and pre process function