Fixed cd in sync()