fix bug with sync