kind of work, but need debug