rename messages table to posts and rename variables accordingly