fixed bug in applying post vars