bug fixes on sync