Add messages to sync. Still working on some optimization.