Fixed bugs and improve design;