Fixing NPE in routing