fix bugs and it can work now