modified the post controller