fix varible scope in post