save posts in database