fix bugs and pretty style