bug fixes in sync functionality