adds validation of posts so title and body cannot be blank