sync can work but still has some bugs