Fixed the sync problem (ight need some cleanup).