fixed errors in routing and enviroment