add pre/post submit functions