add onPut for updating a post; modified form as well.