fix code style & some bug