Added setSync(int sync) method