fix bugs and change routes