fixed post_controller to save posts correctly