initialize isPost properly before accessing