added before filter to post controller