added post to database logic