added update function to posts, and post title validation on save