fixed the posts bug and improved post controller