fix bugs and change layout