use dosync instead of sync