added authentication to add or edit posts