* renamed var
* fixed if-statement in routing
* reduce scope