add some bugs and todo