fix posts view bug
use before_action